LOCAL_PATH := $(call my-dir)
TARGET_DIR:=$(PRODUCT_OUT)/system/lib64/
$(warning "BOSE: COPY from $(LOCAL_PATH) to $(TARGET_DIR)")

define make_dir
$(foreach t,$(1), \
  $(shell mkdir -p $(t) ) \
)
endef

define copy_to_out
$(foreach t,$(1), \
  $(shell cp -arf $(LOCAL_PATH)/$(t) $(TARGET_DIR)/$(t)) \
)
endef

MODULES_TO_COPY += $(filter-out Android.mk, $(notdir $(wildcard $(LOCAL_PATH)/*.so)))

$(call make_dir, $(TARGET_DIR))
$(call copy_to_out, $(MODULES_TO_COPY))

